from HTMLTestRunner import HTMLTestRunner
import unittest, time, os


if __name__ == '__main__':
    now = time.strftime("%Y-%m-%d %H_%M_%S")
    filename = './report/' + now + 'result.html'
    fp = open(filename, 'wb')
    runner = HTMLTestRunner(stream=fp,
                            title='auto test report',
                            description='info:windows 7, browser:Chrome')
    discover = unittest.defaultTestLoader.discover('./test_case',
                                                   pattern='*_sta.py')
    runner.run(discover)
    fp.close()